﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<VCC.Site.ViewModels.BoxCategoryLeftModel>" %>
<div class="container-default">
	<div id="ctl30_BodyContainer">
		<div id="content-main-right">
			<div id="column-right">
				<div>
					<div class="box-left" id="product_search">
						<div class="box-title">
						    Tất cả danh mục
						</div>
						<div id="searchcp">
							<div style="position: relative; z-index: 100;" class="searchrow">
                                <div>
                                    <ul class="list-cate-left">
                                        <%string cClass = "menu-cate-active";
                                              foreach (var m in Model.ParentCategories)
                                              {
                                                  string current  = m.ID  == Model.CurrentCateID ? cClass : string.Empty;
                                                  string cateClass = "itemCate"+m.ID;
                                          %>
                                        <li class="<%=current%>">
                                            <div id="<%=cateClass%>" class="itemCate"></div>
                                            <a class="prcate" href="<%=Html.Encode(Model.Domain + m.ShortName)%>" title="<%=Html.Encode(m.Name)%>"><%=Html.Encode(m.Name)%></a>
                                            <%var childs = m.Categories.Where(e => e.PubYN == true).OrderBy(e => e.Priority).ToList();
                                              if (childs.Count > 0)
                                              { %>
                                            <ul style="padding-left:15px;">
                                                <%foreach (var c in childs)
                                                  {
                                                      var childcurrent =c.ID == Model.CurrentCateID ? cClass : string.Empty;
                                                  %>
                                                <li class="<%=childcurrent%>"><a href="<%=Html.Encode(Model.Domain + c.ShortName)%>" title="<%=Html.Encode(c.Name)%>"><%=Html.Encode(c.Name)%></a></li> 
                                                <%} %>
                                            </ul>
                                            <%} %>
                                        </li>
                                        <%} %>
                                    </ul>   
                                </div>
							</div>
							<div class="clear"></div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
